import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

/* 基础布局组件 */ 
import Layout from "@/layout/index.vue"

const routes:RouteRecordRaw[] = [
    {
        path:'/login',
        name:'Login',
        component:()=> import('@/views/Login/index.vue'),
        meta: { hidden: true, title: '登录' },
    },
    {
        path: '/',
        name: 'Layout',
        component: Layout,
        redirect: '/community-search',
        children: [
          {
            path: 'community-search',
            name: 'CommunitySearch',
            component: () => import('@/views/Search/CommunitySearch/index.vue'),
            meta: { title: '社区查询', icon: 'search' },
          },

        ],
    },
    {
      path: '/',
      name: 'HouseSearch',
      component: Layout,
      redirect: '/house-search',
      
      children: [
        {
          path: 'house-search',
          name: 'house-search',
          component: () => import('@/views/Search/HouseSearch/index.vue'),
          meta: { title: '房屋查询', icon: 'search',alwaysShow: true },
          
        },   
      ],
    },    {
      path: '/',
      name: 'BillSearch',
      component: Layout,
      redirect: '/bill-search',
      children: [
        {
          path: 'bill-search',
          name: 'bill-search',
          component: () => import('@/views/Search/BillSearch/index.vue'),
          meta: { title: '账单查询', icon: 'search',alwaysShow: true },
        }, 
      ],
    },
]

export default createRouter({
    history:createWebHistory(),
    routes
})